/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.raip.io
 *
 * 版权所有，侵权必究！
 */

package com.cz.modules.job.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.io.File;


/**
 * 测试定时任务(演示Demo，可删除)
 *
 * testTask为spring bean的名称
 *
 * @author Mark sunlightcs@gmail.com
 */
@Component("deletePicTask")
public class DeletePicTask implements ITask {
	private Logger logger = LoggerFactory.getLogger(getClass());

	@Override
	public void run(String params) {
		logger.debug("TestTask定时任务正在执行，参数为：{}", params);
		File file =new File("D:\\NovaTraffic\\jietupic");
		if(!file.exists()){
			file.mkdirs();
		}
		File[] files = file.listFiles();
		for(File f:files){
			if(f.isFile()){
				f.delete();
			}
		}

		File file1 =new File("D:\\NovaTraffic\\jietupicn");
		if(!file1.exists()){
			file1.mkdirs();
		}
		File[] files1 = file1.listFiles();
		for(File f:files1){
			if(!f.isDirectory()){
				f.delete();
			}
		}
	}
}
